package pers.qianyu.month_202012.date_20201218;

/**
 * 389. 找不同
 * https://leetcode-cn.com/problems/find-the-difference/
 *
 * @author mizzle rain
 * @date 2020-12-18 21:40
 */
public class FindTheDifference {
    // 位运算
    public char findTheDifference(String s, String t) {
        int a = 0;
        for (int i = 0; i < s.length(); i++) {
            a ^= s.charAt(i);
        }
        for (int i = 0; i < t.length(); i++) {
            a ^= t.charAt(i);
        }
        return (char) a;
    }
}
